import asyncio
from util import delay, async_timed
from PyCmpltrtok.common import sep
import time


def call_later():
    print("I'm being called in the future!")
    print('Sleep 1')
    time.sleep(1)
    print('call_later done.')
    
    
@async_timed()
async def main():
    sep('Will get_event_loop')
    loop = asyncio.get_event_loop()
    print('Gotten running loop, will call_soon')
    loop.call_soon(call_later)
    print('call_soon invoked')
    await delay(1, 'wait', 0.2)
    
    
if '__main__' == __name__:
    asyncio.run(main())
    